package com.flower;

import com.flower.core_service.sources.CoreSink;
import com.flower.core_service.sources.CoreSource;
import com.yomahub.tlog.core.aop.AspectLogAop;
import com.yomahub.tlog.core.enhance.bytes.AspectLogEnhance;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.aop.aspectj.AspectInstanceFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.boot.SpringApplication;


/**
 * @ClassName MedApplication
 * @Description TODO
 * @Author 吃麻椒的花酱
 * @Date 2022/2/26 17:43
 * @Version 1.0
 */
@SpringBootApplication(scanBasePackages = {"com.flower" },exclude = {})
@MapperScan("com.flower.core_service.mapper")
@EnableFeignClients
@EnableDiscoveryClient
@EnableBinding({Source.class, CoreSource.class, Sink.class, CoreSink.class})
// 集成Swagger2 需要配置此选项
//@ComponentScan(basePackages = {"com.flower" })
public class CoreServiceApplication extends SpringBootServletInitializer {
    static {
        AspectLogEnhance.enhance();
    }
    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(CoreServiceApplication.class);
        // cat /Users/zhangxiaohua/resources/sys-code/service/core_service/app.pid | xargs kill
       // application.addListeners(new ApplicationPidFileWriter("/Users/zhangxiaohua/resources/sys-code/service/core_service/app.pid"));


        application.run(args);

    }
}
